﻿using System;
using System.Windows.Input;
using WPFCommon.Commands;
using WPFCommon.ViewModels.Base;

namespace WpfDemo
{
    public class WpfDemoViewModel : ViewModelBase
    {
        public DateTime CurrentDataTime { get; set; }

        public string CurrentTimeText => CurrentDataTime.ToString("HH:mm:ss");

        public ICommand UpdateTimeCommand { get; set; }

        public WpfDemoViewModel()
        {
            UpdateTimeCommand = new RelayCommand(() => { CurrentDataTime = DateTime.Now;});
        }
    }
}